package top.conangao.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import top.conangao.common.entity.BaseDO;
import top.conangao.system.domain.valid.UserValid;

import java.io.Serializable;

/**
 * 用户表
 * @TableName sys_user
 */
@TableName(value ="sys_user")
@Data
public class SysUser extends BaseDO implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id")
    @NotNull(message = "修改必须传id",groups = UserValid.Update.class)
    @Null(message = "新增不需要id",groups = UserValid.Add.class)
    private Long id;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 昵称
     */
    @TableField(value = "nickname")
    private String nickname;

    /**
     * 头像
     */
    @TableField(value = "avatar")
    private String avatar;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 手机号
     */
    @TableField(value = "mobile")
    private String mobile;

    /**
     * 部门
     */
    @TableField(value = "dept_id")
    private Long deptId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}